UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+AmtdzZ+zsHUF6JDZWOcfPFJ+xeDxH/7Ec+8j1pwdsk=' 
WHERE 
  key_id = '0e9e8701f176c04d473465b797dc95c1f5528bae0964ea6b5526124f7fb502c5' 
  AND (
    token = '+AmtdzZ+zsHUF6JDZWOcfPFJ+xeDxH/7Ec+8j1pwdsk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037