UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tk8Qwvgr1YdcE6ffmng4nsC9NX2KDSC4e1CP5PyjJyE=' 
WHERE 
  key_id = '15a76a87f52913d049569eaf54d5ed428a11100d1df15dd55bd07263477dae22' 
  AND (
    token = 'tk8Qwvgr1YdcE6ffmng4nsC9NX2KDSC4e1CP5PyjJyE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030