UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v/WvECeekMJclkroJphBwEryQqpTidChDjmbVIaMKyM=' 
WHERE 
  key_id = '45bb42f4a52d0d595d9aeaf161afbdcb48d346d14c4181f06a7e0f0d9184c010' 
  AND (
    token = 'v/WvECeekMJclkroJphBwEryQqpTidChDjmbVIaMKyM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029