UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PiFi/bDihSX984OxEb3nWh90xwndnkSbFX0eQgKmqrU=' 
WHERE 
  key_id = '706449745c4bf59656e23e6118633f680b1776d20b764ba0104fbc18e648349b' 
  AND (
    token = 'PiFi/bDihSX984OxEb3nWh90xwndnkSbFX0eQgKmqrU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034