UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M97N/Ka7dAvYaTnv6qBUFDrywyiHERp4GGeZiV6kqnA=' 
WHERE 
  key_id = '5760852341c7c913664b25e42c9193149333fc9cadde4b5db7c17ae852f63f9c' 
  AND (
    token = 'M97N/Ka7dAvYaTnv6qBUFDrywyiHERp4GGeZiV6kqnA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052