UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UPBPgufDtydd9XHp0G6MdiNlBB0CC7tiXV4DLa89XJU=' 
WHERE 
  key_id = 'b7d1696a6201bcf6669f4e73f10bc899dee6ede66d78982f1a36c0529da32624' 
  AND (
    token = 'UPBPgufDtydd9XHp0G6MdiNlBB0CC7tiXV4DLa89XJU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033