UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tJVa+Mv7OI3+NWgDA1YgdS3W2WxSJqDB3vvQm96yQps=' 
WHERE 
  key_id = '581cbb2ae0f09393121be3df8b7d68549e763dc09e1ea5ec9186ea6e782ac3e8' 
  AND (
    token = 'tJVa+Mv7OI3+NWgDA1YgdS3W2WxSJqDB3vvQm96yQps=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033