UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5dK8MooTVsgNgU25voksfHWP/cPEXic4c9iSiyJRu6Q=' 
WHERE 
  key_id = '227b86578d001950f7f10aa797c34b5dd7dcd9484a54aa969e7b1a1325fcdc04' 
  AND (
    token = '5dK8MooTVsgNgU25voksfHWP/cPEXic4c9iSiyJRu6Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032