UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HkQuMJvzFUugxjrZ6sSIM1bvnzsbxQT8v0lV1mPpCm8=' 
WHERE 
  key_id = '81c0ab0c1b7ca550b9d4a5ae381f9e998df0c8143cc598dbde674da4d51da074' 
  AND (
    token = 'HkQuMJvzFUugxjrZ6sSIM1bvnzsbxQT8v0lV1mPpCm8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036