UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XSMwmbwJ1vYU5b7m9Xjltp/kFT+KocWOdScbSQTJIKc=' 
WHERE 
  key_id = 'f6919af5899e5a5bc8ec90a6ddb5d8ef9a806e6bf00effb848e853279aea216b' 
  AND (
    token = 'XSMwmbwJ1vYU5b7m9Xjltp/kFT+KocWOdScbSQTJIKc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044