UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xcy+H3Zpdp25brdMpeTmgAa2OwKptfWkgSt3VH9Tckk=' 
WHERE 
  key_id = 'be773d5cbb835ef810a72fa0aa633ae235da4dbaa82d9dc91dcd8364702d4150' 
  AND (
    token = 'xcy+H3Zpdp25brdMpeTmgAa2OwKptfWkgSt3VH9Tckk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043