UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K8//s7Wcs7jkDtmqeKT0KCyCgg8oJhwNDCsFGNrHX90=' 
WHERE 
  key_id = 'b2bde2198790fe2d53539aa5bbe561d95f6b0ba93d24d0a0dcdb58569f4d38ab' 
  AND (
    token = 'K8//s7Wcs7jkDtmqeKT0KCyCgg8oJhwNDCsFGNrHX90=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023