UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f83vU3H+TsKS9r669KDkvvFP7F95QKXX0rdlrMKRYrI=' 
WHERE 
  key_id = '91290839fb9cea3368b3c6da46fb8a1a0ebc5bc9fbc2983c39b5e7e2003da6e8' 
  AND (
    token = 'f83vU3H+TsKS9r669KDkvvFP7F95QKXX0rdlrMKRYrI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034