UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Zm4+Byn9sdXSuV3Zg9DXRLmLiH/QZTHrXcJXCjIjJEA=' 
WHERE 
  key_id = '06064d9c558b860ed10bf0b91c750aba0e13ba0024baac2413534495a8b9e045' 
  AND (
    token = 'Zm4+Byn9sdXSuV3Zg9DXRLmLiH/QZTHrXcJXCjIjJEA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056