UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KqRlmPu3t5T8TFvPdEFYeCTUHugWRf+dZaL/Qn5UsiM=' 
WHERE 
  key_id = '4148ec84d0105e8c117fbb2018b3ebf00a074c4b90a05bf48b0401def6bf0986' 
  AND (
    token = 'KqRlmPu3t5T8TFvPdEFYeCTUHugWRf+dZaL/Qn5UsiM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017