UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'amKvuudTsuJaquZeu1He8Lcez9e3uLCv0ZEMx0g1QO0=' 
WHERE 
  key_id = '0686edaba45c573dfd7782b3d8fa00866a0e4b6d4c2cb48dd694a46136dddd8d' 
  AND (
    token = 'amKvuudTsuJaquZeu1He8Lcez9e3uLCv0ZEMx0g1QO0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027