UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U6GtQumzhabNyVhNMQDRtbxUdtAVfsHff/qHuVvSFqI=' 
WHERE 
  key_id = 'e5154f138cc2be85dc001e3f33a50932cef520e3d826ee0cd4e0f7e90b892f36' 
  AND (
    token = 'U6GtQumzhabNyVhNMQDRtbxUdtAVfsHff/qHuVvSFqI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019