UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fPkvDudZFn72CZLjtx1YhkG4wcIIEkzCACI/BWE5jr0=' 
WHERE 
  key_id = '64475b419bc55aa5d79437a183c6e96d195b637daf96ca558f52ee113e740df8' 
  AND (
    token = 'fPkvDudZFn72CZLjtx1YhkG4wcIIEkzCACI/BWE5jr0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020