UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YmuLaSEi7HWzXj6FnpIceHQUICl6c8IvKPKzMdn8pog=' 
WHERE 
  key_id = 'b0839494458c3067ed3e61652f6d620d2fdcfe2b6f1bb20bef49c82df7a59b4b' 
  AND (
    token = 'YmuLaSEi7HWzXj6FnpIceHQUICl6c8IvKPKzMdn8pog=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035