UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FkC3IO7pxTiS6/NfX5IGjw8YhrX8iDCDY/ZeVNbeij4=' 
WHERE 
  key_id = '8f8a5ef626e796cddbde94a96e3d59a53e1332955b9467cdbb766a30ed809755' 
  AND (
    token = 'FkC3IO7pxTiS6/NfX5IGjw8YhrX8iDCDY/ZeVNbeij4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00068