UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cqswgS7+3scVuUuJ2bc4b9d86Xp/mp69ZhTFuanHzUQ=' 
WHERE 
  key_id = 'fa9424045d0ce663a826c92e03a6ebcd5e4608a6bea8a78c62b59f8ae9b2ff17' 
  AND (
    token = 'cqswgS7+3scVuUuJ2bc4b9d86Xp/mp69ZhTFuanHzUQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021