UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2Qends2Lzbf0RfBJ0JwBYjDRQVnLeZzmfYAgSehonao=' 
WHERE 
  key_id = '136368df62a0c437e460cbe4452d657b217d5527c15b90451a0cca42aea85cd7' 
  AND (
    token = '2Qends2Lzbf0RfBJ0JwBYjDRQVnLeZzmfYAgSehonao=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043