UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P+sHSc5rOM2suf/IrictJmpLcbjhMNBWy3xDj82/Ic0=' 
WHERE 
  key_id = '6a9539d4a77736fb86ca2c64a3d690f1f8bdd15a7c5c09865dee275e3287f5a5' 
  AND (
    token = 'P+sHSc5rOM2suf/IrictJmpLcbjhMNBWy3xDj82/Ic0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021