UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6TFeX3UbaD0mb090ZXTatQK0CAFGj5lVO8zByCIfpNM=' 
WHERE 
  key_id = '646c472260e3733cf96fccf131c4c1b62a7dea8e257d18d4074c7e85bcc71f2e' 
  AND (
    token = '6TFeX3UbaD0mb090ZXTatQK0CAFGj5lVO8zByCIfpNM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027