UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B8ujHHTn5WL5CH1EdnLuCg8edontp5nhxKu4BpjevnU=' 
WHERE 
  key_id = 'bbf38fbd77efc1dee645fcc201647a4895874ffdfd8c32040b3f11cd00d5fdb3' 
  AND (
    token = 'B8ujHHTn5WL5CH1EdnLuCg8edontp5nhxKu4BpjevnU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038