UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pNYKIaoM5dJnqIVKuLij8s/DjQizcHOITEvkCLwF8F8=' 
WHERE 
  key_id = 'c3385a899e7f42c4fb7e6b080a5afc48dc06d8e264e75133b1a709023fd4c441' 
  AND (
    token = 'pNYKIaoM5dJnqIVKuLij8s/DjQizcHOITEvkCLwF8F8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044