UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FKvIYS52mVpUXvq4R3OdZmoyLXCrpMnxiM18srnrcAY=' 
WHERE 
  key_id = '364dac147ac37c82912b02835fd6239566cf54f7e247b4154df9d895cca23735' 
  AND (
    token = 'FKvIYS52mVpUXvq4R3OdZmoyLXCrpMnxiM18srnrcAY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030