UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AZaqx4sdjCD0mb9z8KLCNU0e4lV0FnGQyzeyFZzGxFk=' 
WHERE 
  key_id = '298ef7bba29236ca3a6cf325dbdb9cc0f90a74fe5c4b279047e1bd35e3ff243b' 
  AND (
    token = 'AZaqx4sdjCD0mb9z8KLCNU0e4lV0FnGQyzeyFZzGxFk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022