UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/9qypgMmHwDFn77/NDGFsyAxC+psfshvbfmASwdF8s0=' 
WHERE 
  key_id = '89c9f052a38670644c23fd4c3f2611b8d14d8ee039a99b3cef9bb05eb495c743' 
  AND (
    token = '/9qypgMmHwDFn77/NDGFsyAxC+psfshvbfmASwdF8s0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031