UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1RlfMqNJJEZGECeA1hnydreQ19bIIAfruY2COgWWhIw=' 
WHERE 
  key_id = '4e936262ba7f98c36d04a7d8420c7901d04f0ad2294a44711c207d01f605b9a7' 
  AND (
    token = '1RlfMqNJJEZGECeA1hnydreQ19bIIAfruY2COgWWhIw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024