UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DxI6ZLyXs/6K8o8EXmhfMGliC4jpclYBHdf99GIhloE=' 
WHERE 
  key_id = 'b4d2ffd52e820ad68c081d2fffb3fef8fd2f0ef8b6697b56fbb2ab3cb65d76d5' 
  AND (
    token = 'DxI6ZLyXs/6K8o8EXmhfMGliC4jpclYBHdf99GIhloE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042