UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1/xye4MnGpeYwkcQ/sg3sSmH4uFlgfLrpRQcqk8YUbE=' 
WHERE 
  key_id = '5d6b4c6d0b9a5693a906131c9631a56542e9b871ef061c9d22a2d93e2f29ae41' 
  AND (
    token = '1/xye4MnGpeYwkcQ/sg3sSmH4uFlgfLrpRQcqk8YUbE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037