UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BujqMtQl5tqVz49+vT1+cVGeZM4PamZyhFU2bLWxFRs=' 
WHERE 
  key_id = 'ebc10524bced314e3fcf9edd87d629df09d9b8bfe7936d5cf623ed160212eae6' 
  AND (
    token = 'BujqMtQl5tqVz49+vT1+cVGeZM4PamZyhFU2bLWxFRs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028