UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ESSRNgSiogEDroFprhD2X3+e97ls6K6Rn4OsG6LY/qo=' 
WHERE 
  key_id = '20e546195d13c4cb6b26df7cdb33ef9ab3c961a402881f98b68f8d131f3eb629' 
  AND (
    token = 'ESSRNgSiogEDroFprhD2X3+e97ls6K6Rn4OsG6LY/qo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031