UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wSChW+2syrya2wFEfBipbMWoXsV/Aot/NIl0veXMLLc=' 
WHERE 
  key_id = '76898f5f3a2689d96a8798bd4cbc5bd411cb53ad84c7b00a080bab92b8e91697' 
  AND (
    token = 'wSChW+2syrya2wFEfBipbMWoXsV/Aot/NIl0veXMLLc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028