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

Query time 0.00034