UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0jAzQ/FBH2eIwLYqZu0lc2/zYlcJVDO8/oiYEK152xA=' 
WHERE 
  key_id = '9e69da2e139acd1ccdf09e8bda6b44e1c3166d44f43d50da90f8f08f20e90ad9' 
  AND (
    token = '0jAzQ/FBH2eIwLYqZu0lc2/zYlcJVDO8/oiYEK152xA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054