UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Pgfg+6pF0mExCzRt+6OaKqtNCehYjrUcs1kgVv52KmU=' 
WHERE 
  key_id = '23df0376009f8f5f234a57c6a851d097478a0b9babfea82bbbfcb0a5e6ae854f' 
  AND (
    token = 'Pgfg+6pF0mExCzRt+6OaKqtNCehYjrUcs1kgVv52KmU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036