UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LG0jH2uGovXS+i5UHTevQAWNnCFlv4ht2544LteQIl8=' 
WHERE 
  key_id = '23398fef91e3d4e7c61ebe261a9b091b309022de01552c3b754b0cc963b756cd' 
  AND (
    token = 'LG0jH2uGovXS+i5UHTevQAWNnCFlv4ht2544LteQIl8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00074