UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9wDl01mD5VUDlUhuGX18YdEQw2E8bmro4iKu4JMvr4c=' 
WHERE 
  key_id = 'a81bb1901f375cec439d0d17f5e6dd0cc7a25b686f7e09eeb49f1d6bda9bd6e3' 
  AND (
    token = '9wDl01mD5VUDlUhuGX18YdEQw2E8bmro4iKu4JMvr4c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030