UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V30ngqV+0ju0PIZJ+DFrDn1F+2laRRi5WgNeyzUOaCs=' 
WHERE 
  key_id = '9a45062517cd5ea1ea0a7f2c73931ca01752c9d56192a99246492bcd5b56f8cc' 
  AND (
    token = 'V30ngqV+0ju0PIZJ+DFrDn1F+2laRRi5WgNeyzUOaCs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021