UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8p4x/ZM6bSbMhn9VUSvzFdV6hOKhesDRM1gwtPy3aMo=' 
WHERE 
  key_id = 'f9ff6cd4f60ccdb114326cbe7c3676eff38edcf29a0ba2e9812a0f342dd3d8ef' 
  AND (
    token = '8p4x/ZM6bSbMhn9VUSvzFdV6hOKhesDRM1gwtPy3aMo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059