UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w5ibbzIh1xCQv+3lmcYBCpHm/j+ZOrILld2MXsW9OHQ=' 
WHERE 
  key_id = '9eccbcec251cb4ac38086f89d7fb88dd1a0302bbb7af0be4b187e8f696ce18ca' 
  AND (
    token = 'w5ibbzIh1xCQv+3lmcYBCpHm/j+ZOrILld2MXsW9OHQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029