UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vdLXYnvBhz29VAJSyR2cfsM28VyhgRePFE6+w8315ro=' 
WHERE 
  key_id = '11c72feeb05947ccfa19605bc09df0e70c7cde9b84ea552540285f9b1b51c128' 
  AND (
    token = 'vdLXYnvBhz29VAJSyR2cfsM28VyhgRePFE6+w8315ro=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038