UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hkvuJOPXGKuz27e9BMFit//WBktxIphWtMcjbqA6Dz8=' 
WHERE 
  key_id = 'fcc2a7794d8ff00866a252a33f706def4ddb2ee154de2ecfba86895ef435f4a8' 
  AND (
    token = 'hkvuJOPXGKuz27e9BMFit//WBktxIphWtMcjbqA6Dz8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037