UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wxby9ieBmJV4bKIT8/lIz2WK8ry/bo8p71OmjOaWuVo=' 
WHERE 
  key_id = '43b5e4bb0aee22b9bfb52fa883fabdadb4778e724c63b80a2247b0640bc3b3e4' 
  AND (
    token = 'Wxby9ieBmJV4bKIT8/lIz2WK8ry/bo8p71OmjOaWuVo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046