UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IMHPIj4gS0kWQj8Ifdd6Te/1tYKuucULsh1FGuJHaR8=' 
WHERE 
  key_id = '2e6b6871df3eb83950526111ab1858c191cb0de1ac7a17377e8a26ccaf8f9230' 
  AND (
    token = 'IMHPIj4gS0kWQj8Ifdd6Te/1tYKuucULsh1FGuJHaR8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028